﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace VistaOnlineR1._1.Models
{
    public class UsuarioModelo
    {
        public class CambioPasswordModel
        {
            [Required]
            [DataType(DataType.Password)]
            [Display(Name = "Password Actual")]
            public string OldPassword { get; set; }

            [Required]
            [StringLength(100, ErrorMessage = "Minimo para el password es de {0} caracteres.", MinimumLength = 6)]
            [DataType(DataType.Password)]
            [Display(Name = "Password Nuevo")]
            public string NewPassword { get; set; }

            [DataType(DataType.Password)]
            [Display(Name = "Confirma new Password")]
            [Compare("NewPassword", ErrorMessage = "Nueva contraseña y confirmación de contraseña no son lo mismo.")]
            public string ConfirmPassword { get; set; }
        }


        public class ResetPasswordModel
        {
            [Required]
            [Display(Name = "Username")]
            public string Username { get; set; }

            public void ResetPassword(string username)
            {
                MembershipUser currentUser = Membership.GetUser(username);
                string password = currentUser.ResetPassword();
                //SendResetEmail(currentUser);
            }
        }


        



    }
}